using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Entities;
using Bll;

public partial class MyAccount : MyPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (HttpContext.Current.Session["Login"] != null)
            {
                IsMemberPage = true;
                ArrayList arr = (ArrayList)HttpContext.Current.Session["Login"];
                CustomerBll custBll = new CustomerBll();

                CustomerInfo cust = custBll.GetByUserName(arr[0].ToString());
                lblFirstName.Text = cust.FirstName;
                lblLastName.Text = cust.LastName;
                lblAddress.Text = cust.Address;
                lblCity.Text = cust.City;
                lblPhone.Text = cust.Phone;
                lblEmail.Text = cust.Email;
                lblDateOfBirth.Text = cust.DateOfBirth.ToString();
                lblBankName.Text = cust.BankName;
                lblAccountNumber.Text = cust.AccountNumber;
                lblTaxCode.Text = cust.TaxCode;
                lblUsername.Text = cust.UserName;
            }
            else
            {
                Response.Redirect("home.aspx");
            }
        }
    }
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        Response.Redirect("EditPersonalInformation.aspx");
    }
    protected void btnChanpassword_Click(object sender, EventArgs e)
    {
        Response.Redirect("ChangePassword.aspx");
    }
}
